package com.dwring.springboot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.dwring.springboot.mapper.UserMapper;
import com.dwring.springboot.model.User;

/**
 * Created by zhanghaichang on 2017/8/3.
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserMapper userMapper;

    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    public User load(@PathVariable("id") int id){
        User user=userMapper.selectById(id);
        return user;
    }


}
